import QtQuick 2.0
import QtQuick.Layouts 1.3

Rectangle {
    id:titleBar
    border.width: 1
    border.color: "red"

    height: 40
//    width:parent.width

    property alias title: titleText.text

    signal back()

    MouseArea{
        height: titleBar.height
        width: 50
        Text{
            anchors.centerIn: parent
            text: "返回"
        }
        onClicked: {
            back();
        }
    }

    Text{
        id:titleText
        height: titleBar.height
        width: titleBar.width - 50
        anchors.centerIn: titleBar
        text:"标题"
    }
}
